package com.scheduling.product.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 工序数据传输对象
 *
 * @author 开发团队
 * @since 2025-05-29
 */
@Data
@Schema(description = "工序信息")
public class OperationDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "工序ID")
    private String operationId;

    @Schema(description = "工艺路线ID", required = true)
    @NotBlank(message = "工艺路线ID不能为空")
    private String routeId;

    @Schema(description = "工序编号", required = true)
    @NotBlank(message = "工序编号不能为空")
    private String operationCode;

    @Schema(description = "工序名称", required = true)
    @NotBlank(message = "工序名称不能为空")
    private String operationName;

    @Schema(description = "所需机器类型ID", required = true)
    @NotBlank(message = "机器类型ID不能为空")
    private String machineTypeId;

    @Schema(description = "标准作业时间(分钟)", required = true)
    @NotNull(message = "标准作业时间不能为空")
    @Min(value = 1, message = "标准作业时间必须大于0")
    private Integer standardTime;

    @Schema(description = "前置工序ID(逗号分隔)")
    private String predecessorOps;

    /**
     * 工序序号
     */
    @NotNull(message = "工序序号不能为空")
    @Min(value = 1, message = "工序序号必须大于0")
    private Integer sequenceNo;

    @Schema(description = "机器类型名称")
    private String machineTypeName;

    @Schema(description = "工序所需原料列表")
    private List<OperationMaterialDTO> materials;
} 